<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.wap.framework.util.Constants;"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%><%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <!-- base href="<%=basePath+"admin" + "/"%>" /-->    
    <title>内容编辑</title>
    <link rel="stylesheet" type="text/css" href="skin/css/base.css" />
    <script type="text/javascript">
    	function changeState()
    	{
    		var obj = document.contentFM.status;
    		var selVal = obj.options[obj.selectedIndex].value;
    		document.contentFM.selIndex.value = selVal;	 		
    	}
    	
    	function doUpdate()
    	{
    		if(document.contentFM.selIndex.value == 255)
    		{
    			alert("请选择状态!");
    			return false;
    		}
    		else{
    		
    			return true;
    		}
    	}
    </script>
    
   <script type="text/javascript" charset="utf-8" src="./kedit/kindeditor.js"></script>
   <script type="text/javascript">
   try{
    KE.init({
        id : 'content1',
        cssPath : './indexe.css',
        //skinType:'tinymce',
        items : ['source',    'preview', 'undo', 'redo',  'link', 'unlink',
         'image','specialchar','date','time'  ]
    });
    
    
     KE.event.ready(function(){
               // KE.create(editorId);
                var editorId = 'content1';
                try{
                KE.create(editorId);
                }catch(e){
                	alert(e.message)
                }
               
                //IE下回车时生成<br />
			     KE.util.pToBr(editorId);

               
            });
          }catch(e){
              	alert(e.message)
              }
   </script>
  </head>  
  <body leftmargin="8" topmargin="8" background='skin/images/allbg.gif'>
		<!--  内容列表   -->
		<form name="contentFM" action="<%=path%>/admin/contentMgr.do" method="post">
			<input type="hidden" name="execute" value="update">			
			<input type="hidden" name="contentID" value="${content.id}">
			<input type="hidden" name="selIndex" value="">
			<table width="98%" border="0" cellpadding="2" cellspacing="1"
				bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="2" background="skin/images/tbg.gif">
						&nbsp;内容列表&nbsp;
					</td>
				</tr>
				<tr height="22">
					<td width="4%" bgcolor="#FAFAF1" align="right">
						ID
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						${content.id}
					</td>
				</tr>
				<tr height="22">
					<td width="4%" bgcolor="#FAFAF1" align="right">
						标题
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<input type="text" name="title" size="50" value="${content.title}">
					</td>
				</tr>
				<tr height="22">
					<td width="4%" bgcolor="#FAFAF1" align="right">
						地址
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<%=Constants.PAGE_ACCESS_URL%>?id=${content.id}
					</td>
				</tr>
				<tr height="22">
					<td width="4%" bgcolor="#FAFAF1" align="right">
						内容
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<textarea name="content" rows="40" cols="50" id="content1"  style="width:300px;height:400px;visibility:hidden;">${content.content}</textarea>				
					</td>					
				</tr>
				<tr height="22">
					<td width="4%" bgcolor="#FAFAF1" align="right">
						状态
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<select name="status" onchange="changeState()">
							<option value="255">-- 请选择 --</option>
							<option value="0" <c:if test="${content.status == 0 }"><%="selected"%></c:if>>停止浏览</option>
							<option value="1" <c:if test="${content.status == 1 }"><%="selected"%></c:if>>开放浏览</option>
						</select>
					</td>
				</tr>								
				
				<tr bgcolor="#FAFAF1">
					<td height="35" colspan="10">
						&nbsp;		
						<input type="submit" class="coolbg" name="button"  onclick="return doUpdate()" value="保存修改" />		
					</td>
				</tr>			
			</table>
		</form>		
	</body>
</html>
